package ide.ccf.ccproject.wizards;

import ide.ccf.ccproject.CCFNature;
import ide.ccf.ccproject.ProjectConstants;
//import ide.ccf.ccproject.managedbuilder.CCFCCBuildWizard;
//import ide.ccf.ccproject.managedbuilder.ManagedBuildWizard;
import ide.ccf.ccproject.translate.Message;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CProjectNature;
//import org.eclipse.cdt.make.core.MakeCorePlugin;
//import org.eclipse.cdt.make.core.MakeProjectNature;


/**
 * The wizard to create new CCF_C++ Project.
 */
public class CCProjectWizard extends CCFCommonProjectWizard {

	public CCProjectWizard() {
		super(Message.NewModelProjectWizard_2, Message.NewModelProjectWizard_3); 
	}
	
	@Override
	public String[] getNatures() {
		return new String[] { CProjectNature.C_NATURE_ID, CCProjectNature.CC_NATURE_ID,  ProjectConstants.NATURE_ID};
	}
	
	@Override
	protected IProject continueCreation(IProject prj) {
		if (continueCreationMonitor == null) {
			continueCreationMonitor = new NullProgressMonitor();
		}
		
		try {
			continueCreationMonitor.beginTask(Message.CCProjectWizard_0, 2); 
			CProjectNature.addCNature(prj, new SubProgressMonitor(continueCreationMonitor, 1));
			CCProjectNature.addCCNature(prj, new SubProgressMonitor(continueCreationMonitor, 1));
			CCFNature.addCCFNature(prj, new SubProgressMonitor(continueCreationMonitor, 1));
			//MakeProjectNature.addNature(prj, new SubProgressMonitor(continueCreationMonitor, 1));//add mencius
		} catch (CoreException e) {}
		finally {continueCreationMonitor.done();}
		return prj;
	}
	
	@Override
	public String[] getContentTypeIDs() {
		return new String[] { CCorePlugin.CONTENT_TYPE_CXXSOURCE, CCorePlugin.CONTENT_TYPE_CXXHEADER };
	}


	public void projectCreated(IProject project, IProgressMonitor monitor) {
		// TODO Auto-generated method stub
		
	}

}